package com.itheima.tlias.model.response;

/**
 * @author byzhao
 * @created 2024-03-29 15:23:35
 * @describtion 通用响应码枚举类
 * <p>
 * ① 构造私有化
 * ② 提供属性get/ set方法
 */
public enum CommonCodeEnum implements Code {

    SUCCESS(1, "成功"),
    ERROR(0, "失败");

    private Integer code;

    private String msg;


    /**
     *  枚举构造器本来就是私有的
     * @param code 响应码
     * @param msg 响应描述
     */
     CommonCodeEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getMsg() {
        return this.msg;
    }
}
